package com.wzh.controll;

import com.wzh.pojo.Po.Notes;
import com.wzh.pojo.Po.UserZp;
import com.wzh.pojo.Req.DataReq;
import com.wzh.pojo.Resp.DataResp;
import com.wzh.service.NoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/Notes")
public class NotesController {
   @Autowired
   private NoteService noteService;


	@PostMapping("/addNote")
	@ResponseBody
	public DataResp addNote(@RequestBody Notes notes){
		System.out.println(notes);
		DataResp<Object> resp= noteService.addnote(notes);
		return resp;
	};

	@PostMapping("/FindNote")
	@ResponseBody
	public DataResp FindNote(@RequestBody DataReq req){
		System.out.println(req);
		DataResp<Object> resp = noteService.findnotes(req);
		return resp;
	};

	@PostMapping("/FindNoteByPhone")
	@ResponseBody
	public DataResp FindNoteByPhone(@RequestBody UserZp userZp){
		System.out.println(userZp);
		DataResp<Object> resp = noteService.FindNoteByPhone(userZp);
		return resp;
	};
}
